<?php
namespace app\controller\model;

use app\BaseController;
use app\controller\model\apis;
use think\facade\Db;

class Service extends BaseController
{
	protected $develop=false;
	protected $model;
	protected $tables,$yeepayA2,$class;
    public function __construct($serviceID=0){
	    $this->tables = new Tables();
	    $this->yeepayA2 = DB::name($this->tables->yeepayA2)->where("id",$serviceID)->find();
	    if(!$this->yeepayA2) return false;
		$this->setModel();
    }
	//获取余额  内包含了待分账金额
	public function getPayMoney(){
		$re = $this->model->getPayMoney();
		return $re;
	}
	//代扣
	public function getAmount(){
		$re = $this->model->getAmount();
		return $re;
	}
	//不能使用变量直接调用方法，会有任意执行漏洞
	protected function setModel(){
		$this->model = new apis\service\Bochuang($this->yeepayA2);
		if($this->model==null) echojson([],1,'缺少接口文件');
	}

}
?>